﻿#region Header

// <file>
//     <copyright see="prj:///doc/copyright.txt"/>
//     <license see="prj:///doc/license.txt"/>
//     <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
//     <version>$Revision: 3037 $</version>
// </file>

#endregion Header

namespace ICSharpCode.TextEditor.Document
{
    using System.Collections.Generic;

    /// <summary>
    /// A highlighting strategy for a buffer.
    /// </summary>
    public interface IHighlightingStrategy
    {
        #region Properties

        /// <value>
        /// The file extenstions on which this highlighting strategy gets
        /// used
        /// </value>
        string[] Extensions
        {
            get;
        }

        /// <value>
        /// The name of the highlighting strategy, must be unique
        /// </value>
        string Name
        {
            get;
        }

        Dictionary<string, string> Properties
        {
            get;
        }

        #endregion Properties

        #region Methods

        // returns special color. (BackGround Color, Cursor Color and so on)
        /// <remarks>
        /// Gets the color of an Environment element.
        /// </remarks>
        HighlightColor GetColorFor(string name);

        /// <remarks>
        /// Used internally, do not call
        /// </remarks>
        void MarkTokens(IDocument document, List<LineSegment> lines);

        /// <remarks>
        /// Used internally, do not call
        /// </remarks>
        void MarkTokens(IDocument document);

        #endregion Methods
    }

    public interface IHighlightingStrategyUsingRuleSets : IHighlightingStrategy
    {
        #region Methods

        /// <remarks>
        /// Used internally, do not call
        /// </remarks>
        HighlightColor GetColor(IDocument document, LineSegment keyWord, int index, int length);

        /// <remarks>
        /// Used internally, do not call
        /// </remarks>
        HighlightRuleSet GetRuleSet(Span span);

        #endregion Methods
    }
}